<?php $this->load->view('config/header');?>
<h1>Submenu <small>form entry</small></h1>
<ol class="breadcrumb">
  <li><a href="<?php echo site_url()?>home"><i class="icon-dashboard"></i> Dashboard</a></li>
  <li><a href="<?php echo site_url()?>setsubmenu"><i class="icon-briefcase"></i> Submenu</a></li>
  <li class="active"><i class="icon-file-alt"></i> Form <?php echo $mode; ?></li>
</ol>

<form class="form-horizontal" role="form" method="post" action="<?php echo site_url() ?>setsubmenu/<?php echo $action; ?>">
	<input type="hidden" class="form-control" name="id_submenu" value="<?php echo @$detail[0]['id_submenu']?>">
	<div class="form-group">
		<label for="id_menu" class="col-lg-2 control-label">Menu</label>
		<div class="col-lg-6">
			<select class="form-control" name="id_menu">
				<?php if (@$menu):?>
					<?php foreach ($menu as $row):?>
						<?php if ($row['id_menu'] == @$detail[0]['id_menu']):?>
							<?php $selected =  'selected="selected"' ?>
						<?php else :?>
							<?php $selected =  '' ?>
						<?php endif;?>
						<option value="<?php echo $row['id_menu'] ?>" <?php echo $selected ?> ><?php echo $row['nama_menu'] ?></option>
					<?php endforeach?>
				<?php else :?>	
					<option value="">Belum ada Menu</option>
				<?php endif?>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="nama_submenu" class="col-lg-2 control-label">Name Submenu</label>
		<div class="col-lg-6">
			<input type="text" class="form-control" name="nama_submenu" value="<?php echo @$detail[0]['nama_submenu']?>" >
		</div>
	</div>
	<div class="form-group">
		<label for="urutan_submenu" class="col-lg-2 control-label">Urutan Submenu</label>
		<div class="col-lg-1">
			<input type="text" class="form-control" name="urutan_submenu" value="<?php echo @$detail[0]['urutan_submenu']?>" >
		</div>
	</div>
	<div class="form-group">
		<label for="type_submenu" class="col-lg-2 control-label">Type Submenu</label>
		<div class="col-lg-4">
			<?php $selected1 =  ''; ?>
			<?php $selected2 =  ''; ?>
			<?php $selected3 =  ''; ?>
			<?php $selected4 =  ''; ?>
			<?php $selected5 =  ''; ?>
			<?php $selected6 =  ''; ?>
			<?php $selected7 =  ''; ?>
			<select class="form-control" name="type_submenu">
				<?php if (@$detail[0]['type_submenu'] == 1):?>
					<?php $selected1 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_submenu'] == 2):?>
					<?php $selected2 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_submenu'] == 3):?>
					<?php $selected3 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_submenu'] == 4):?>
					<?php $selected4 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_submenu'] == 5):?>
					<?php $selected5 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_submenu'] == 6):?>
					<?php $selected6 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['type_submenu'] == 7):?>
					<?php $selected7 =  'selected="selected"' ?>
				<?php else :?>
					<?php $selected1 =  ''; ?>
					<?php $selected2 =  ''; ?>
					<?php $selected3 =  ''; ?>
					<?php $selected4 =  ''; ?>
					<?php $selected5 =  ''; ?>
					<?php $selected6 =  ''; ?>
					<?php $selected7 =  ''; ?>
				<?php endif;?>
				<option value="1" <?php echo $selected1; ?> > Description Content</option>
				<option value="2" <?php echo $selected2; ?> > List Content</option>
				<option value="3" <?php echo $selected3; ?> > Product Content</option>
				<option value="4" <?php echo $selected4; ?> > Gallery Content</option>
				<option value="5" <?php echo $selected5; ?> > Opinion Content</option>
				<option value="6" <?php echo $selected6; ?> > Testimonial Content</option>
				<option value="7" <?php echo $selected7; ?> > Location Content</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="enable_submenu" class="col-lg-2 control-label">Enable</label>
		<div class="col-lg-2">
			<?php $selected1 =  ''; ?>
			<?php $selected2 =  ''; ?>
			<select class="form-control" name="enable_submenu">
				<?php if (@$detail[0]['enable_submenu'] == 1):?>
					<?php $selected1 =  'selected="selected"' ?>
				<?php elseif (@$detail[0]['enable_submenu'] == 0):?>
					<?php $selected2 =  'selected="selected"' ?>
				<?php else :?>
					<?php $selected1 =  ''; ?>
					<?php $selected2 =  ''; ?>
				<?php endif;?>
				<option value="1" <?php echo $selected1; ?> >Aktif</option>
				<option value="0" <?php echo $selected2; ?> >Non Aktif</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<div class="col-lg-offset-2 col-lg-10">
			<input type="submit" name="submit" value="Simpan" class="btn btn-primary"/>
			<a href="<?php echo site_url()?>setsubmenu" class="btn btn-primary">Batal</a>
		</div>
	</div>
</form>

<?php $this->load->view('config/footer');?>